package com.furongji.education.clients;

import com.furongji.common.domain.vo.UserOrderVo;
import com.furongji.common.domain.vo.UserSimpleVo;
import com.furongji.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "user-service")
public interface UserFeignClient {

    @GetMapping("/api/users/getUserOrderInfo")
    public UserOrderVo getUserOrderInfo(@RequestHeader("Authorization") String token);

    @GetMapping("/api/users/getUserInfo")
    public Result getUserInfo(@RequestHeader("Authorization") String token);

    // 统计注册人数
    @GetMapping("/admin/users/registerCount/{date}")
    public Integer registerCount(@PathVariable String date);

    // 统计登录人数
    @GetMapping("/admin/users/loginCount/{date}")
    public Integer loginCount(@PathVariable String date);

    // 给评论模块
    @GetMapping("/api/users/getNameAndAvatar")
    public UserSimpleVo getNameAndAvatar(@RequestParam String userId);
}
